package com.itbupt.infrastructure.persistent.dao;

import cn.bugstack.middleware.db.router.annotation.DBRouter;
import cn.bugstack.middleware.db.router.annotation.DBRouterStrategy;
import com.itbupt.infrastructure.persistent.po.UserRaffleOrder;
import org.apache.ibatis.annotations.Mapper;

/**
 * @Author dingchang
 * @Date 2025/4/2 16:21
 * @Description: 用户抽奖订单Dao
 */

@Mapper
@DBRouterStrategy(splitTable = true)
public interface IUserRaffleOrderDao {
    /**
     * 查询未使用的抽奖单 -
     * @param userRaffleOrderReq 抽奖订单表
     * @return UserRaffleOrder
     */
    @DBRouter
    UserRaffleOrder queryNoUsedRaffleOrder(UserRaffleOrder userRaffleOrderReq);

    /**
     * 写入一笔订单
     * @param userRaffleOrder
     */
    void insert(UserRaffleOrder userRaffleOrder);

    /**
     * 更新抽奖单状态为已使用 - used
     * @param userRaffleOrderReq
     * @return
     */
    int updateUserRaffleOrderStateUsed(UserRaffleOrder userRaffleOrderReq);

}
